With respect to RAID (Redundant Arrays of Inexpensive Disks) data storage device, a fast calculation of parity is needed to achieve the optimizing performance. In FIG. 1(a), a conventional RAID data storage device is shown and contains a host 111, a RAID controller 112 and a disk array 113 which is consisted of two or more disk drives 1131. The conventional RAID data storage device is moving bulk data between the host 111 and the disk drives 1131, in which the RAID controller 112 is responsible to distribute the data across the disk drives 1131 and to generate parities or lost data. Please refer to FIG. 1(b), which is an operation flowchart of the conventional RAID data storage device. When the conventional RAID data storage device is moving bulk data between the host 111 and the disk drives 1131, the host 111 issues command to the RAID controller 112, and then the RAID controller 112 is responsible to take care of the request. The RAID controller 112 takes appropriate actions to satisfy the request at step 1152 of FIG. 1(b). The step 1152 is that the host 111 accesses the disk drives and issues command to the RAID controller 112. The response of the RAID controller 112 are described as follows:
For write operation, the host 111 intends to write data into the disk drives, the steps are as follow. Firstly, the host 111 gives the RAID controller 112 new data which were ready to be written to the disk drives 1131 at step 1155. At step 1155, the host 111 transfers new data to the RAID controller 112. Then, at step 1156, the RAID controller 112 performs XOR calculation to generate new parity and the RAID controller 112 writes the new data and new parity into the disk drives 1131.
For read operation, the host 111 intends to read data from the disk drives 1131, and the steps are as follow. At step 1153, the RAID controller 112 gets old data and old parity from the disk drives 1131, and then the RAID controller 112 performs XOR calculation to rebuild the lost data. To proceed to the step 1154, the host 111 takes back the wanted data.
In the above descriptions for the read operation, the assumption is that there is one disk failure. This assumption is applied to explain the techniques of the present application conveniently. In the text of the present application, the assumption that there is one disk failure is applied. Another assumption must be declared first that the transferring quantity for each request launched by the host is N data block.
Please refer to FIG. 2(a) which illustrates the data flow for write operation of the conventional RAID data storage device which contains a host 111, a host controller 1111, a DMA (direct memory access) controller 141, a local memory 142, an XOR circuit 143, a disk controller 144, an internal bus 145 for transferring commands and data, and a plurality of disk drives 1131. The XOR circuit 143 contains a buffer 1431, a multiplexer 1432 and a XOR component 1433. During the write operation, new N data are moved into the local memory 142 first (as the solid line), and then the XOR circuit 143 fetches data from the local memory 142 (as the dot line) and performs XOR calculation. The calculated new parity is pushed in buffer 1431 temporarily and then stored into the local memory 142 (as the dash-dot line). Finally, both new N data and new parity are written to the disk drives 1131 (as the dash line). The amount of using the internal bus 145 is 3N+2.
Please refer to FIG. 2(b) which illustrates the data flow for read operation of the conventional RAID data storage device. Old N−1 data and old parity are first read from the disk drives 1131 and saved into the local memory 142 (as the dash line). The XOR circuit 143 reads these old data and old parity from the local memory 142 (as the dot line) and performs XOR calculation to recover lost data. The recovered data is saved in the buffer 1431 temporarily and then stored into the local memory 142 (as the dash-dot line) for the host 111 to read. The amount of using the internal bus 145 is 3N+1.
Please refer to FIG. 2(c) which shows the RAID controller operational flowchart for a conventional method. Under such operational mechanism, the amount of using the internal bus 145 is 3N+2 for write operation and 3N+1 for read operation. However, the data moving between the host 111 and the local memory 142 is necessary. That is, the local memory 142 must be accessed at least twice with the data block that the host 111 intends to transfer. In this architecture of FIG. 2(a) and FIG. 2(b), we can presume that the performance would be declined rapidly while the amount of disk drives increased. Hence, in order to solve the above problem, the device and method of the present invention are provided.